package Transaction;

import Payment.Payment;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;


/**
 *
 * @author Howard Wong
 *
 * This is the transaction object containing the various info a customer's
 * order will include, as well as customer information.
 *
 * Is this supposed to manage the array of Transactions, in TransactionItems
 * like how it has it in the reader?
 *
 * Contains a transaction header, and a collection of transaction items,
 * and the payment
 *
 */
public class Transaction implements Serializable {

    private TransactionHeader header;
    private Payment payment;
    private List<TransactionItem> items;

    public Transaction(TransactionHeader header, Payment payment) {
        this.header = header;
        this.items = new ArrayList<TransactionItem>();
        this.payment = payment;
    }

    public void addItem(TransactionItem item) {
        this.items.add(item);
    }

    public List<TransactionItem> getItems(){

        return this.items;
    }
}
